package Qimo;

public class MaiPiao extends Thread{

    Object object=new Object();

    @Override
    public void run() {

            synchronized (object){
                for (int i = 100; i <= 0; i++) {
                    System.out.println(Thread.currentThread().getName()+"卖第"+i+"票");
                    try {
                        Thread.sleep(300);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                }
            }

    }
}
